<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>身份验证</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/renting/css/public.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/renting/css/layui.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/renting/css/header.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/renting/css/bottom.css"/>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/renting/css/tenant_public.css"/>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/renting/css/tenant_ID_verification.css"/>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/layui/lib/layui-v2.6.3/css/layui.css" media="all"/>
</head>
<body>
<div class="header">
    <div class="nav">
        <a href="${pageContext.request.contextPath}/renting/index.jsp" class="nav_title">好客租房</a>
        <select class="select">
            <option value="重庆">重庆</option>
            <option value="贵阳">贵阳</option>
            <option value="重庆">重庆</option>
            <option value="贵阳">贵阳</option>
        </select>
        <ul class="nav_ul">
            <li><a href="${pageContext.request.contextPath}/renting/index.jsp">首页</a></li>
            <li><a href="${pageContext.request.contextPath}/renting/pages/onther/Findroom.jsp">轻松找房</a></li>
            <li><a href="${pageContext.request.contextPath}/renting/pages/onther/entry.jsp">房东入驻</a></li>
            <li><a href="${pageContext.request.contextPath}/renting/pages/onther/chat_news.jsp">消息</a></li>
            <li><a href="${pageContext.request.contextPath}/renting/pages/onther/login.jsp" style="color: #2981c8;">登录</a></li>
        </ul>
        <img src="${pageContext.request.contextPath}/renting/img/icon/lianxi-1.png" class="nav_img" style="margin-top: -20px;">
        <p class="nav_phone">
            <span>13301131116</span>
            <span>13301131116</span>
        </p>
    </div>
</div>
<div class="body">
    <div class="portrait_bg">
        <div class="portrait">
            <a href="${pageContext.request.contextPath}/renting/pages/onther/personal.jsp" class="headImg">
                <img style="width: 100px;height: 100px;border-radius: 100%" src="../../img/${drom.avater}">
            </a>
        </div>
        <p class="nickname">点击头像编辑个人资料</p>
    </div>
    <div class="content">
        <ul class="left_ul">
            <li><a href="${pageContext.request.contextPath}/renting/pages/tenant/inspection.jsp"><img src="${pageContext.request.contextPath}/renting/img/xuanzhongtiao.png" >看房记录</a></li>
            <li><a href="${pageContext.request.contextPath}/renting/pages/tenant/appointment.jsp"><img src="${pageContext.request.contextPath}/renting/img/xuanzhongtiao.png" >我的预约</a></li>
            <li><a href="${pageContext.request.contextPath}/renting/pages/tenant/order.jsp"><img src="${pageContext.request.contextPath}/renting/img/xuanzhongtiao.png" >我的订单</a></li>
            <li><a href="${pageContext.request.contextPath}/renting/pages/tenant/collection.jsp"><img src="${pageContext.request.contextPath}/renting/img/xuanzhongtiao.png" >我的收藏</a></li>
            <li><a href="${pageContext.request.contextPath}/renting/pages/tenant/wallet.jsp"><img src="${pageContext.request.contextPath}/renting/img/xuanzhongtiao.png" >我的钱包</a></li>
            <li class="li_active"><a href="${pageContext.request.contextPath}/renting/pages/tenant/ID_verification.jsp"><img src="${pageContext.request.contextPath}/renting/img/xuanzhongtiao.png" >身份验证</a></li>
            <li><a href="${pageContext.request.contextPath}/renting/pages/tenant/contract.jsp"><img src="${pageContext.request.contextPath}/renting/img/xuanzhongtiao.png" >电子合同</a></li>
            <li><a href="${pageContext.request.contextPath}/renting/pages/tenant/about.jsp"><img src="${pageContext.request.contextPath}/renting/img/xuanzhongtiao.png" >联系我们</a></li>
        </ul>
        <div class="right_body">
            <div class="right_content">
                <div class="right_title">
                    <p>身份验证<span id="tipebox" style="font-size: 16px;color: orange;display: none">< 已实名 ></span></p>
                </div>
                <div class="stripe"></div>
                <div class="right_main">
                    <form id="updataImg" class="upload" method="post" enctype="multipart/form-data">
                        <label style="display: inline-block;">
                            <img src="${pageContext.request.contextPath}/renting/img/sfz-zheng.png" class="imgupl">
                            <input type="file" name="filess" class="imgup1" value="" hidden="hidden" />
                        </label>
                        <label style="display: inline-block;">
                            <img src="${pageContext.request.contextPath}/renting/img/sfz-zheng.png" class="imgupl">
                            <input type="file" name="filess" class="imgup2" value="" hidden="hidden" />
                        </label>
                        <br>
                        <input style="text-align: center" value="立即验证" class="btn_sub">
                    </form>
                </div>
            </div>
        </div>
        <div style="clear: both;"></div>
    </div>
</div>
<div class="bottom">
    <p>沪公网安备 31011402005354号</p>
</div>
</body>
</html>
<script src="${pageContext.request.contextPath}/renting/js/jQuery-3.4.1.js"></script>
<script src="${pageContext.request.contextPath}/layui/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script src="${pageContext.request.contextPath}/renting/js/tenant_ID_verification.js"></script>
<script src="${pageContext.request.contextPath}/renting/js/header.js"></script>
<script type="text/javascript">
    judge_login("${pageContext.request.contextPath}/renting/pages/tenant/inspection.jsp","${pageContext.request.contextPath}/renting/pages/onther/login.jsp");
</script>
<script src="${pageContext.request.contextPath}/renting/js/ScrollHolder.js"></script>
<script type="text/javascript">
    //全局layui
    layui.use(["layer"],function (){


        //获取默认数据
        $.ajax({
            url:'${pageContext.request.contextPath}/userInfo/getuserRealData',
            type:'post',
            async: false,
            dataType:"json",
            success:function (redata){
                if(redata.statecode==0){
                    var datas = redata.data;
                    $("#tipebox").css("display","inline-block");
                    $(".btn_sub").remove();
                    $("#updataImg label img").remove();
                    $("#updataImg label:eq(0)").append("<img src='../../img/"+datas.idCardF+"' class='imgupl'>");
                    $("#updataImg label:eq(1)").append("<img src='../../img/"+datas.idCardN+"' class='imgupl'>");
                    console.log(redata);
                }else{

                }
            },
            error:function (e){
                console.log(e)
            }
        })


        //点击上传按钮
        $(".btn_sub").click(function(){
            //通过ajax上传
            let formData = new FormData();
            let file1 = $(".imgup1")[0].files;
            let file2 = $(".imgup2")[0].files;

            if(file1.length==0||file2.length==0){
                //console.log(file1)
                layer.msg("身份证正面反面图片都需要哦",{icon:2});
            }else{
                formData.append("filess",file1[0]);
                formData.append("filess",file2[0]);
                $.ajax({
                    url:'${pageContext.request.contextPath}/userInfo/realaction',
                    type:'post',
                    async:false,
                    data:formData,
                    dataType:'json',
                    processData: false,
                    contentType: false,
                    success:function (redata){
                        if(redata.statecode==0){
                            layer.msg(redata.msg,{icon:1});
                        }else{
                            layer.msg(redata.msg,{icon:2})
                        }
                        console.log(redata);
                    },
                    error:function (e){
                        console.log(e)
                    }
                })
            }
        });








    })









</script>